package com.hut.oa.model.bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
/**
 * 附件表
 * @author 潘寻毅
 *
 */
@Entity
@Table(name="attachment_")
public class Attachment {
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="att_id")
	private Long id;//附件id
	
	@Column(name="att_type",nullable=false)
	private String type;//附件类型
	
	@Column(name="att_name",nullable=false)
	private String name;//附件名称
	
	@Column(name="att_path",nullable=false)
	private String path;//附件路径
	
	@Column(name="att_size")
	private Long size;//附件大小
	
	@Column(name="att_uploadtime")
	private Date uploadtime=new Date();//上传时间
	
	@Column(name="user_id")
	private Long userId;//用户id
	
	@Column(name="att_module",nullable=false)
	private String module;//所属模块
	
	@Column(name="att_business_id")
	private Long businessId;//业务id
	
	@Column(name="att_suffix")
	private String suffix;//后缀

	public Attachment() {
		super();
	}
	
	public Attachment(String type, String name, String path, Long size,Long userId, String module,
			String suffix) {
		super();
		this.type = type;
		this.name = name;
		this.path = path;
		this.size = size;
		this.userId = userId;
		this.module = module;
		this.suffix = suffix;
	}



	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public Long getSize() {
		return size;
	}

	public void setSize(Long size) {
		this.size = size;
	}
	
	public Date getUploadtime() {
		return uploadtime;
	}

	public void setUploadtime(Date uploadtime) {
		this.uploadtime = uploadtime;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getModule() {
		return module;
	}

	public void setModule(String module) {
		this.module = module;
	}

	public Long getBusinessId() {
		return businessId;
	}

	public void setBusinessId(Long businessId) {
		this.businessId = businessId;
	}

	public String getSuffix() {
		return suffix;
	}

	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}

	@Override
	public String toString() {
		return "Attachment [id=" + id + ", type=" + type + ", name=" + name + ", path=" + path + ", size=" + size
				+ ", uploadtime=" + uploadtime + ", userId=" + userId + ", module=" + module + ", businessId="
				+ businessId + ", suffix=" + suffix + "]";
	}
	
}
